package com.aispeech.testcustom.listener;

import android.support.annotation.NonNull;

import com.aispeech.aios.sdk.listener.AIOSCustomizeListener;
import com.aispeech.aios.sdk.manager.AIOSTTSManager;
import com.aispeech.testcustom.i.CustomResultCallBack;
import com.aispeech.testcustom.utils.TiLog;

/**
 * Created by rain on 2016/11/16.
 */
public class CustomizeListener implements AIOSCustomizeListener {
    CustomResultCallBack callBack;

    public CustomizeListener(CustomResultCallBack callBack) {
        this.callBack = callBack;
    }

    @Override
    public void onShortcutWakeUp(@NonNull String s) {
        TiLog.w("test", "onShortcutWakeUp() called with: " + "s = [" + s + "]");
        AIOSTTSManager.speak("收到唤醒回调");
        callBack.setResultBack(s);
    }

    @Override
    public void onCommandEffect(@NonNull String s) {
        TiLog.w("test", "onCommandEffect() called with: " + "s = [" + s + "]");
        AIOSTTSManager.speak("收到自定义指令");
        callBack.setResultBack(s);
    }
}
